package com.chenju.javastatic.domain.pojo;

import com.chenju.javastatic.common.enums.EasyCode.DiffType;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.util.List;

@Setter
@Getter
@NoArgsConstructor
public class DiffPoJo {
    private Long id;
    private String name;
    private String methodName;
    private String methodDesc;
    private DiffType diffType;
    private List<DiffMethodDetailPoJo> diffDetails;
    private String oldContent;
    private String newContent;

    public DiffPoJo(String name) {
        this.name = name;
    }

    public DiffPoJo(String name, String methodName, String methodDesc, DiffType diffType, List<DiffMethodDetailPoJo> diffDetails) {
        this.name = name;
        this.methodName = methodName;
        this.methodDesc = methodDesc;
        this.diffType = diffType;
        this.diffDetails = diffDetails;
    }

    public DiffPoJo(String name, String methodName, String methodDesc, DiffType diffType, List<DiffMethodDetailPoJo> diffDetails, String oldContent, String newContent) {
        this.name = name;
        this.methodName = methodName;
        this.methodDesc = methodDesc;
        this.diffType = diffType;
        this.diffDetails = diffDetails;
        this.oldContent = oldContent;
        this.newContent = newContent;
    }

    @Override
    public String toString() {
        return "DiffPoJo{\n" +
                "\tname='" + name + '\'' + ",\n" +
                "\tmethodName='" + methodName + '\'' + ",\n" +
                "\tmethodDesc='" + methodDesc + '\'' + ",\n" +
                "\tdiffType=" + diffType.toString() + ",\n" +
                "\toldContent=" + oldContent + ",\n" +
                "\tnewContent=" + newContent + ",\n" +
                "\tdiffDetails=" + diffDetails.toString() + ",\n" +
                '}';
    }
}
